gtktextattributes: Only use transparent union for g-ir-scanner
authorColin Walters <walters@verbum.org>
Wed, 13 Nov 2013 17:59:57 +0000 (12:59 -0500)
committerColin Walters <walters@verbum.org>
Wed, 13 Nov 2013 17:59:57 +0000 (12:59 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=711158

gtk/gtktextattributes.h

index 616fc8b24c44ce6959df1be14f6209c01f01c8b4..cd20c7c82c3ed8bd1654822260269a5fc30f2d4e 100644 (file)
@@ -94,10 +94,24 @@ struct _GtkTextAppearance
   guint inside_selection : 1;
   guint is_text : 1;
 
+  /* For the sad story of this bit of code, see
+   * https://bugzilla.gnome.org/show_bug.cgi?id=711158
+   */
+#ifdef __GI_SCANNER__
+  /* The scanner should only see the transparent union, so that its
+   * content does not vary across architectures.
+   */
   union {
     GdkRGBA *rgba[2];
     guint padding[4];
   };
+#else
+  GdkRGBA *rgba[2];
+#if (defined(__SIZEOF_INT__) && defined(__SIZEOF_POINTER__)) && (__SIZEOF_INT__ == __SIZEOF_POINTER__)
+  /* unusable, just for ABI compat */
+  guint padding[2];
+#endif
+#endif
 };
 
 /**